﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CarHelpDesk.Web.Models.Repositories.TestRepositories
{
    public class AnswersRepository : IAnswersRepository
    {
        private List<Answer> data;

        public AnswersRepository()
        {
            data = new List<Answer>();
        }

        public AnswersRepository(List<Answer> initialListAnswers)
        {
            data = initialListAnswers;
        }

        #region IAnswersRepository Members

        public IQueryable<Answer> getAnswersByQuestionID(int questionID)
        {
            return from p in data.AsQueryable<Answer>()
                   where questionID == p.QuestionID
                   select p;
        }

        public void Create(Answer answer)
        {
            data.Add(answer);
        }

        public Answer getAnswerByID(int answerID)
        {
            return (from p in data.AsQueryable<Answer>()
                   where answerID == p.ID
                   select p).First();
        }

        public void DeleteAnswersByQuestionID(int questionID)
        {
            throw new NotImplementedException();
        }

        public void Update(Answer answer)
        {
            throw new NotImplementedException();
        }

        public void MarkAnswerAsCorrect(Answer answer)
        {
            throw new NotImplementedException();
        }

        public AnswerVote GetAnswerVote(Answer answer, Guid userID)
        {
            throw new NotImplementedException();
        }

        public void CreateAnswerVote(AnswerVote vote)
        {
            throw new NotImplementedException();
        }

        public void DeleteAnswerVoteByAnswerID(int answerID)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
